package org.karelun.gef.editors;

import org.eclipse.draw2d.PositionConstants;
import org.eclipse.gef.ui.palette.FlyoutPaletteComposite.FlyoutPreferences;
import org.karelun.gef.Activator;

public class PaletteFlyoutPreferences implements FlyoutPreferences {

	public static final int DEFAULT_PALETTE_WIDTH = 150;

	protected static final String PALETTE_DOCK_LOCATION = "Dock location"; //$NON-NLS-1$
	protected static final String PALETTE_SIZE = "Palette Size"; //$NON-NLS-1$
	protected static final String PALETTE_STATE = "Palette state"; //$NON-NLS-1$

	public int getDockLocation() {
		int location = 0;
		if (location == 0) {
			return PositionConstants.WEST;
		}
		return location;
	}

	public int getPaletteState() {
		int state = 0;
		return state;
	}

	public int getPaletteWidth() {
		int width = 0;
		if (width == 0)
			return DEFAULT_PALETTE_WIDTH;
		return width;
	}

	public void setDockLocation(int location) {
		Activator.getDefault().getPreferenceStore().setValue(
				PALETTE_DOCK_LOCATION, location);
	}

	public void setPaletteState(int state) {
		Activator.getDefault().getPreferenceStore().setValue(PALETTE_STATE,
				state);
	}

	public void setPaletteWidth(int width) {
		Activator.getDefault().getPreferenceStore().setValue(PALETTE_SIZE,
				width);
	}
}